Uploaded image for project: 'Commons CLI'
  1. Commons CLI
  2. CLI-167

Support options like Java memory settings (-Xmx512M)

    XMLWordPrintableJSON

Details

    • Improvement
    • Status: Closed
    • Minor
    • Resolution: Fixed
    • None
    • 1.3
    • Parser
    • None

    Description

      This is a RFE to implement the java memory setting style of option, that is a single hyphen with a long option name and a value immediately after.

      For example: -Xmx512M

      public void testJavaMemorySettings() throws Exception {
          Options options = new Options();
          options.addOption(OptionBuilder.withLongOpt("Xmx").hasArg().create("Xmx"));
      
          Parser parser = new GnuParser();
          CommandLine cl = parser.parse(options, new  String[] { "-Xmx512M" });
      
          assertTrue(cl.hasOption("Xmx"));
          assertEquals("512M", cl.getOptionValue("Xmx"));
      }
      

      Attachments

        Activity

          People

            ebourg Emmanuel Bourg
            ebourg Emmanuel Bourg
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: